import { Request, Response } from 'umi';

const list = [
  {
    id: 1,
    name: 'bilimiao',
    icon: '//oss.10miaomiao.cn/images/bilimiao.png',
    intro: '哔哩哔哩时光机',
    author: "10喵喵",
    
  },
  {
    id: 2,
    name: 'bilimiao2',
    icon: '//oss.10miaomiao.cn/images/bilimiao.png',
    intro: '哔哩哔哩时光机',
  }
]

export default {
	"/miao/project/list": {
    list,
    count: list.length,
    pageIndex: 1,
    pageSize: 10,
    pageCount: 1,
  },
	"/miao/project/:id": (req: Request, res: Response) => {
		const id = req.param("id")
		if(id){
			const data = list.find(item => parseInt(id) === item.id)
			if(data){
        res.send(data);
        return
			}
		}
		res.status(404);
		res.send({ status: 404, message: "错误" });
	},
}

